package ch7;

import java.util.Arrays;

public class ArrayMerge {
	// 数组合并
	public static void main(String[] args) {
		int[] arr = { 22, 6, 5, 4, 12 };
		int[] arr2 = { 3, 12, 0, 12, 5, 4, 7 };
		int[] newArr = Arrays.copyOf(arr, arr.length + arr2.length);
		for (int j = arr.length; j < newArr.length; j++) {
			newArr[j] = arr2[j - arr.length];
		}
		System.out.println(Arrays.toString(newArr));

	}
}
